package com.zhijian.medical.dao.local;

import com.zhijian.medical.entity.po.Mdt;
import com.zhijian.medical.entity.vo.request.MdtSearchVo;
import com.zhijian.medical.entity.vo.response.MdtVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MdtMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Mdt record);

    int insertSelective(Mdt record);

    Mdt selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Mdt record);

    int updateByPrimaryKey(Mdt record);

    /**
     * 查询总数
     *
     * @param mdtSearchVo
     * @return
     */
    int count(MdtSearchVo mdtSearchVo);

    /**
     * 查询列表
     *
     * @param mdtSearchVo
     * @return
     */
    List<MdtVo> selectList(MdtSearchVo mdtSearchVo);

    /**
     * 查询单个
     *
     * @param mdtSearchVo
     * @return
     */
    MdtVo selectOne(MdtSearchVo mdtSearchVo);

    /**
     * 根据ID查询vo
     *
     * @param id
     * @return
     */
    MdtVo selectVoById(Long id);

    /**
     * 批量删除
     *
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    /**
     * 动态删除
     *
     * @param mdtSearchVo
     * @return
     */
    void deleteByCondition(MdtSearchVo mdtSearchVo);

    /**
     * 批量新增
     *
     * @param entities
     * @return
     */
    int insertBatch(@Param("entities") List<Mdt> entities);

    /**
     * 查询出某天最新数据的code
     *
     * @return
     */
    String selectMaxCodeByDay(String day);
}